<?php
declare (strict_types = 1);

namespace app\middleware;

class AdminAuth
{
    public function handle($request, \Closure $next)
    {
        $admin_id = session('admin_id');
        define('ADMINID', $admin_id);
        if (empty(ADMINID)){
            return redirect((string) url('login/index'));
        }
        return $next($request);
    }
}
